import httpRequest from '@/utils/httpRequest'


export function login (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/login'),
    method: 'post',
    data: httpRequest.adornData(data)
  })
}

export function logout (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/logout'),
    method: 'post',
    data: httpRequest.adornData(data)
  })
}

export function updatePassword (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/user/password'),
    method: 'post',
    data: httpRequest.adornData(data)
  })
}

export function getPermissions (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/menu/nav'),
    method: 'get',
    params: httpRequest.adornParams(data)
  })
}

export function getCaptchaUrl (uuid) {
  return httpRequest.adornUrl(`/captcha.jpg?uuid=${uuid}`)
}
